package com.naiterui.ehp.bs.patient.service.impl;

import com.naiterui.ehp.bp.constants.DrSystemConfEnum;
import com.naiterui.ehp.bs.patient.repository.IApDrSystemConfRepository;
import com.naiterui.ehp.bs.patient.service.IDrSystemConfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * TODO: 临时方案，后续恢复为工具类，并在CMS可配置
 * @Description 系统配置
 * @Author gongbaoqiang
 * @Date 2020/7/9 5:36 PM
 */
@Service
public class AdDrSystemConfServiceImpl implements IDrSystemConfService {

    @Autowired
    private IApDrSystemConfRepository systemConfRepository;

    @Override
    public Boolean isPediatrics(Integer departmentId) {

        return systemConfRepository.existsByConfCodeAndConfValue(DrSystemConfEnum.DR_DEPARTMENT_PAEDIATRICS.getCode(), departmentId.toString());
    }
}
